import jakarta.servlet.annotation.WebInitParam;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;

@WebServlet(name = "TestServlet3", urlPatterns = "/TestServlet3",
        initParams = {
        @WebInitParam(name ="韦国荣", value = "2班"),
                @WebInitParam(name ="小六子", value = "可接受的"),
                @WebInitParam(name ="大嫂", value = "收到货")
        }
)

public class TestServlet3 extends HttpServlet {
    protected void doGet(HttpServletRequest request,
                         HttpServletResponse response) throws SecurityException, IOException {
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out = response.getWriter();
        Enumeration<String> names = this.getInitParameterNames();
        while (names.hasMoreElements()) {
            String name = names.nextElement();
            String value = this.getInitParameter(name);
            out.println((name+":"+value));
        }
    }
    protected void doPost(HttpServletRequest request,
                         HttpServletResponse response) throws SecurityException, IOException {}
}
